# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : zsj.py
# @Time     : 2024/4/8 22:36
# @Author   : Robot-Zsj
"""
description:

input
2 4
output
2

"""
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)

m, n = map(int, input().split())


@lru_cache
def recursive(level, low, high, remain):
    if level == m - 1:
        if remain - low <= 3:
            return 1
        return 0
    ans = 0
    for i in range(low, high + 1):
        remain -= i
        ans += recursive(level + 1, i, min(i + 3, remain // (m - level - 1)), remain)
        remain += i
    return ans


def getResult():
    if m == 1:
        return 1
    else:
        return recursive(0, 1, n // m, n)


print(getResult())
